
function checkUserid(name){
	var result = name.match(/^[a-zA-Z]\w{5,31}$/);
	if(name==null||name=="")
	{document.getElementById("msg").innerHTML = "用户名不能为空！" ;
	return false;}
	else if(result==null){
		document.getElementById("msg").innerHTML = "用户名只能包含字母数字和下划线！且为6~32位！" ;
		return false;
	}
	else {
		document.getElementById("msg").innerHTML = "" ;
		return true;
	}
}
function checkphone(phonenum){
	var result = phonenum.match(/((13[0-9])|(15[0-9])|(18[0-9]))\\d{9}$/);
	if(phonenum==null||phonenum=="")
	{document.getElementById("msg3").innerHTML = "手机号不能为空！" ;
	return false;}
	else if(result==null){
		document.getElementById("msg3").innerHTML = "手机号位数不正确！" ;
		return false;
	}
	else {
		document.getElementById("msg3").innerHTML = "" ;
		return true;
	}
}

function checkemail(email){
	var result = email.match(/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/);
	if(email==null||email=="")
	{document.getElementById("msg4").innerHTML = "email地址不能为空！" ;
	return false;}
	else if(result==null){
		document.getElementById("msg4").innerHTML = "email格式不正确！" ;
		return false;
	}
	else {
		document.getElementById("msg4").innerHTML = "" ;
		return true;
	}
}
function checkpass(pass)
{
	var result = pass.match(/^[a-zA-Z]\w{5,15}$/);/^[a-zA-Z]\w{5,31}$/
if(pass==null||pass=="")
{document.getElementById("msg1").innerHTML = "密码不能为空！" ;
 return false;}
else if(result==null){
	document.getElementById("msg1").innerHTML = "密码必须由字母数字组成，且以字母开头！6~16位！" ;
	return false;
}
else {
document.getElementById("msg1").innerHTML = "" ;
return true;}
}
function checkrepeatpass(repass){
if(repass!=document.getElementById('password').value)
{document.getElementById("msg2").innerHTML = "两次输入密码不一致，请重新输入！" ;
return false;}
else {
document.getElementById("msg2").innerHTML = "" ;
return true;}
}
function checkform(){
if(checkUserid&&checkrepeatpass&&checkpass&&checkemail&&checkphone)
document.form1.submit();}
